A few fixes, it now compiles.

Didn't change much, just got it to compile. Only four functions remain,
hopefully someone can do those early tomorrow so I can wrap the project
up tomorrow night.