fixes and new tests