Fixed various compile-time errors. Still needs runtime test.

Signed-off-by: Paul G <p.ganssle@gmail.com>