Fixed misc compile errors exposed when compiling new SCF codes.