20130725: Added exception handling for critical code sections