clean up extra newline
Be a little bit more flexible about passed-in context