semantic: Fix some bugs found by the latest DMD.