bugfixes
add more tests