Solved some minor bugs