Once applying the rootpath, null it so it will not be applied again
Fix import errors in browser mode. Fixes #1117 and fixes #1118