More code path test coverage

Added test coverage for untested code paths (mostly error handling) revealed by 'go tool cover'.
c.Assert(err, gc.ErrorMatches, "cannot generate random bytes: fail")
?