a few minor bugfixes and the first test case