Engine: fixed reading more than a single command from hooks