This fixes a regression introduced in 6d302f639. Thanks lorinkoz at gmail.com for the report, Collin Anderson for the initial patch and Simon Charette for the review.