Fix type names and errors