Improvements an bugfixes