Don't offer auto completion after }, as that is usually followed by a newline.
Also cleanup the code while at it.