Same comment as above.  Make sure the code within in a code chunk is full functional...  Stopping and starting will cause problems with that.