Added exception catching to test app as an example.