For the source of the issue with the knit button, this is a little confusing to me. The only difference between rmarkdown::render() in your console and clicking the knit button is that the button runs render in a new session.
Yihui has some discussion of what's going on with here