fixed couple of js editor bugs