Check better for invalid XP return values.

Based on @hwoarangmy's input on this.