Fixes issue #251

This pr fixes issue #251.