Some bugs correction