Error handling, docs, and convenience functions