Some bug correction. Automation is still not ok.