Fixed error handling for remote processes