Fix validation bug, add docstrings for life cycle functions