Bugfix and some tweaks.