Changes from pull request by stevedomin on Dec 3, 2013