Fixed the power function for negative n