Fixed bugs from yesterday's code