Fix for isssue #496
Merge pull request #548 from anders-chrigstrom/master

Fix for isssue #496