More generator tests and fixes