Script fixed for Mac OS X Mavericks.