Code clean up and error checking added for conquest