[OTFC] Better error handling and more unit tests.