Some bugs fixed.