Lab 5-6 bugs

Some bugs need fix.