Add coverage and exception handling