Fix #329

As proposed in #329, but since there was no PR referred yet, I decided to add it.