small improvements/fixes
Various bug fixes