Adam's changes to avoid wrong XG.. or ..GX sequence input