Fixing #2191

This is my proposed fix for #2191.

This post is open for review and comments (not ready for merge yet).