Fix compiling error for mex routines.