Resolve issue with double inclusion of a module

See #812

***Rebased #814 against 1.2.1***