Improving coverage and adding missing tests.