Fix type errors in operations