Minor cleaning and bugfix