Fixes chapters 5 and 6

The last fixes for chapters 5 and 6 :)