Correct some type issues