Ref #21 - Test fixes and error handling improvements