Fixed some bugs in the bounds checker.