Added the ability to quit the client 'properly' (in a hacky way).