Some more fixes in dispatch codegen