Fixes #1: add unit tests