Extra check on bounds. Fixes #260