fix scripts/stage tests
fix undefined "pow" symbol on Ubuntu 13.04