Fixed bug with IsInvFull function