Fix the proximity trigger

Who wrote this memleaking nightmare bit of code!?
This needs far more work than this little bandaid, but this is all I
have time for.