Integrating Guzin's changes into master branch
Bringing changes over from iserc.