Fix some strange behaviour when using mavericks.