Unified changes from rmelick and reved version to 1.4
Unified changes from rmelick and reved version to 1.4