cleanups and fix JS issue.