Make it compile with DMD 2.066
Fixed some other problems and tests.