Some fixes to the Stonesense changes to help it work on older OSes