Fix Solaris SEGV bug: null pointer passed to sprintf()
Improve test framework: fix some minor awk bugs