Some random messing about as well as some changes to make the code compile on git HEAD dmd
Fix build