Fixed Issue #1: error code was not propagated to the main process.