Manually added pull #9's changes.