Minor Tweaking and bug fixing