More code path test coverage

Added test coverage for untested code paths (mostly error handling) revealed by 'go tool cover'.
please assert the exact error message (or at least some prefix of it) using gc.ErrorMatches, and below.