Some bug correction