Fix existing tests and add a new one