Some small fixes and a new test