Fix some compiler warnings, a few bugs, need to track down a SIGSEV now though o.O