Fix handling of multiline class/module definitions

Fixes #642