Better bounds checking