Fix bug affecting '\r' newlines and final-character '/'