Fix compile error with using incorrect type