Fix power function