Fix Max and Unix compilation

Change-Id: I64fb035659a7b4d45004c84dcf409e91fad32fa4