Fix the errors from Tiger Dai

Please review the code changes