Initial import, first attempt to fix compiler errors