Some bugs fixed;