Set local variables, bug fixes for pre-Mavericks