Add basic error handling
Style tweak