Minor cleanup and Mac fixes