Add early checks and some documentation.