fix according to code review and fix broken examples