add include guards and fix compilation error on g++
optional: add covnersion to bool
compatibility improvements