Fix global leaks, use strict
Remove unused