Fix if cond is not None and if cond is None errors,

Don't display success message if error occurred, Docstrings for two
functions