Bug fix for #138.
Closes #153.
Invert initaliser after having inverted logic.
Merge pull request #158 from adavidzh/limit-boundary-checks

Bug fix for #138.