Fix free-ing issues on non-mac machines.