Fixed some bugs

These two were stopping me from running the generate script at all.