Fixed tests and increased test coverage