Fix compile errors and update some types.