Externalized error handling in create tx sample, minor cleanup.