fix compile errors and other changes