Make emit more robust