Some fixes regarding passing strings around on the gcc or when not using extensions in msvc; Fixed inventory closing bugs introduced by scripting changes