Fixed browser/nodejs detection in pre.js and post.js