Fix some type issues