dmd: fix 32-bit build and some nitpicks

CC #4976.