fixed some compilation errors on 10.6