Fix boundary condition checking bug.
Merge pull request #39 from atgeirr/master

Fix boundary condition checking bug.