Moved error reporting configuration to top
Removed repetition in setting paths code
Added comments