Replace deprecated Mac code.