Fixed few bugs, clear some chain, improve speed