Code coverage for error cases
Applying code review feedback