Fixing potential errors and getting unit testing functional

Fixing potential errors in filenames and function names that are
generated; getting unit testing functional.