Fixed last minute bugs

Fixed last minute bugs