Remove unnecessary trailing newline