Maybe the problems come from the wrong try to remove the ENABLE_IMPACT:

my.emask |= ~ENABLE_IMPACT;

This should be

my.emask &= ~ENABLE_IMPACT;

Regards,
Pegamode.