I found a little issued in the ver. 2, so this is a good opportunity to fix it, but in the meantime here is the Fix version with some adjustments, I'll post the version 2 as soon is ready.
Enjoy