minor bugfix and tweaks