Removed bugs in bndCheck

Removed a couple of bugs and reordered a some checks.