Basic changes to `pow`

Removed quite a bit of seg-faults. With this change all earlier
tests pass, however the `sqrt(2)` test still fails.
Need a couple of more cases to handle them.