[FIX] Version of #69 that can be merged automatically.

Adding merge to #69 that was done locally.