Updated for 10.10 and higher compatibility.