Fix double joining due to prerender

The changes outside main.js is due to a merge with the Master branch and are not introduced by this PR.
CC: @tkchin