Fix #389

- courtesy of @jodamm