Updating and fix bugs