Fix compile errors in code