Fixed bugs 6