some return codes fixed, debug is in progress