Fix issue #276

Tested locally.