"Fixed" a linux (and possibly windows) crash when removing objects
Various changes