Fixed various dt related bugs