More changes to get it to work. Would be so much easier if compiler errors could be picked up before I commit.