Now declares test functions with -M flag.
Fixed possible buffer overflow