Testing code improvements.

Added a test program.