Fix #167 incompatible pointer types warnings

This fixes the warnings. I hope it doesn't break anything else.