Changes suggested by @shivawu.