Finalize powm module.
Few optimalization.