fix settings again, and cleanup

I hate js so much
..
Merge pull request #72 from Hellowlol/shutdownjs

Shutdownjs fix