Fix portability issues in test runner script