compilation with clang. One bug fixed, the other I suspect a bug of clang