fix some bugs in tutorial, patch by Erick Tryzelaar