Added delete lastmessage on disconnect; changed line endings to match OS.