Added exception handling; Removed unused code and parameters
Merge TFS Changeset 1289