Now using system to return bad error code on failure, along with wierdly necessary import