Small changes, fixed some bugs