Fix bounds checking

The bounds check should be done only when the end bound is set.
When the end bound is unset any start bound is valid.