Fix type problems