Removed last \r\n
Fixed tests and refactoring toString