Bug with stray newlines on stdin messing with simulation query fixed.