Fixing generate method.