Clean up error handling in Binary example. Add additional test cases.

Old example did not handle all error strings properly. Fixed example to better handle errors. And, added additional test cases.