Reflect changes from #516.

@twokul would that be consider an enhancement, right? :)