Various fixes from OpenJK and JA++
Compiles with clang