Compile fixes and patches
compoile fixes