fixed boundary collisions, fixes #23