generator: Fix bugs.