Fix for #1378 on the github issue tracker.