Fixed bugs for POW function, which didn't return error value.