Some bug corrections and layout changes