compile fixes and cleanups