Second attempt to fix logic error in process status functions

Fix #4791.