Freedom Physics: fixes for mem errors/crashing

fixes for mem errors/crashing