little fixes and test improvements