Fix crash from caused by #783

(I should really test these things before merging)