fix behavior and docs of nextpow and prevpow. closes #4819