Tweaks to make portable to server environment