Replace CRLF with LF, fix bugs, .im support