bugfix + quality improvements