Fixed few minor bugs after testing