well this is the altered version i use (plus sources), but it is stripped of some features i were not using in hopes of optimizing performance by reducing garbace colletion of c#. (it is not really relevant nor noticable)
the version i posted before was the original with my attempt at fixing the 2 bugs and leaving the rest unchanged.
This is not my mod. i feel a bit uneasy posting here anything beyond bug fixes...