Merged fix of bug 207 from master branch