Some syntax cleanup

I also fixed a small bug in the textarea when an empty newline remains after submitting a chat.