Fixes return value retrieval in command pipe