Cleaning and fixes