Removed some bugs