fix bugs, make work with newer version of sweet.js
small cleanup and stabilizing