fix return. add assert. fix docs.