Fixed a 'lead' bug and general clean up