Some bugs removed