Issue #526 fixing Mohab's comments