clang port

misc. changes to enable compilation with clang 3.3