Some more tweaks
Improved error protection