In the previous versions of the NM, detecting the case when worker is shutting down was not that important and actual status code did not matter much. However, that might be not the case all the time. This commit makes necessary modifications to the code.