Fix a bug of surface error and tests