minor bugfix + cleanup