Fixed some minor bugs

Fixed some minor bugs