Merging #6008 changes

bug fixes and added polish for initial release.