Fix bug with FF causing newline to appear when something is typed. #321