Minor tweaks
Improved error handling some what (most functions return an int)
Less prints