fixes for darwin

Change-Id: I0b1586fd6eb7e4b4a40ddc520aa9415bac5de211