Fix some bugs, remove JS