Add 'flags' parameter to the 'test' helper. Version to 0.6.16.
Fix hang up bug.

(cherry picked from commit 741ac98b9c34fdd4339867968c9d25352abfd1d1)
Version 0.6.17.