Fixed to build in new reality.
Fixed some compile-time warnings.