Fixed bugs

Fixed bugs.