Fixed warnings when compiling with clang

Added missing includes, defines and similar things