Fixed bugs, added functionalities to editor