fixing a bug caught by Peter - see test for details. Closes https://github.com/davidedc/livecodelab/issues/239
Merge remote-tracking branch 'upstream/master'