fix #301

Waiting for #300 to merge to avoid conflicts.