Fixing setCode generation