Fixed bugs with the program