Changed the lines of object generator that caused errors