Catching exceptions properly
Added 'vendor' namespace
Misc code cleanup