Tweaks and bug fixed