It should check to make sure the folder exists first... does /mysitefolder/ exist on your live server?
The assumed root takes a local root and remote root argument that are set in the top of the code based on your site definition. There is no way for it to really know if you are on one server or the other, so it tests to see if the folder exists if it doesn't it uses the other path. You may be able to switch the local and remote root values or remove or rename that folder if it isn't needed.