Fix some bugs, preparing stage for tomorrow's work