tweaks to compile with clang, works mosltly...