Some fixes 

Hi @jferrao, 

Thank you for your gate applet. 

I use it for long, but is suffers some issues. 
I have fixed them and I hop you will merge and release it. 
For me this is a better solution then release it as a fork. 

Kind regads, 

Daniel