Fixed #838, thanks @Not-steve