Range Check Fixes

Fixed the range check so should be working again.