fix testMode issue
fix array size determination issue