Fix a failing test. Make sure to trim not needed new lines from the start and end of the exception message
Remove unused code