Fix for isssue #595