Improved coverage, removed dead code, etc