Fix compilation with DMD >=2.066

and little unrelated cleanup.