-[COMPATIBILITY] Added explicit casts to support C++0x (GNU++11) compilation. This is useful when compiling ejecta as a static lib.