Fixed a couple of bits and tidied up