Fix build errors on Mac

Fix build errors on Mac