Fix issue with appended \n in result
Remove unused variables