Code cleaning and several changes.