Removed warnings and tidy up.