Fixed #004 and neatened things up