Bug fix plus fix rest of examples