Fix return value error in doc, and an error test