Bugs Fixing

Fix minor bugs