Make power function work nicely with powers of 0 or 1