Fixed #6. Also documentation tidy ups.