Fixing minor bugs