Fixed bugs caused by changes in Mojo API