Misc fixes and enhancements including fix for Issue 1.