Ensure pio enabled.
Fix comment
Add error return codes
Add comments