Cleanup and fix warnings and such.