Fixed allowing stop block to be placed in the middle of a script

Fixes #228.