Fixed new Javascript function references and merge errors