cleanup(generator): Add missing cast, eliminate unused import.