First attempt at fixes for Mavericks.