Fixed some bugs. Fixed interface