Fixining up minor bugs