Fixes warning and errors in Mac target