Fixed few minor bugs