Minor improvements to the testapp and library

fixed the getstat function so it actually returns something now

Added a few try catches