Tidy up code. Fixed a warning