A bugfix for #969
Merge pull request #971 from oesteban/bug/fix969

A bugfix for #969