Tests and bugfixes2 hm

Fixed #8, #34, #54, #57, #59