Harden core extension's createMixin.

Harden and add unit test.