Test coverage and cleanups

What intentionally-not-closed cursor is that comment talking about?