Merge pull request #243 from konrad-kruczynski/bug3661