still more 64-bit fixes for incorrect downcasting