Core/Collision: Fix memory leak
Core/Misc: Fix invalid pointer use after being deleted
Core/Misc: Another batch of fixes for issues found by static analysis