Tiny fixes, added tests