Fixing up type difference bugs