Compile fixes and warnings