Added icon
Replaced some error handling with exceptions