Fixing minor bugs and typos