Fix type conversion that linq didn't like