small fixes and test