New tutorial code & bugfixes