Changed some interfaces, fixwed some bugs.