Fix bbox bounds checking