Fix type issues