Tweak to fix casting errors