Add notes about cap checks and improve input validation