Fix type of generated objects