Fix counting cores to work in MaxOSX (by Simon)