Made the makeobj code saner