Fixed up the syntax etc. of the engine.

Also made the stacktrace display "Timeout" instead of
"None" when a timeout was reached instead of a packet.
Merge pull request #4 from BlackVegetable/engine-fixes

edit of engine code