Change Popen to check_output.