several fixes for maverick / clang and libc++