Bug fix

Fixed bugs