Fixes exponentiation function.

Fixes exponentiation function.