Fixed some runtime errors with contact reduction (still not working properly