Adds missing coverage for error cases