Documentation and stricter checking for expected actions and hooks