Fix BaseBlockCommand to work with block at the boundaries of the view

Locating blocks near the beginning or the end of a view were failing. Fixed.