fixes boundary check, adds integration tests
0.16.1