Fix compile errors due to warnings