fix null pointer, boost and stuff