Implemented fixes suggested by Colin