Improve mac support