Fix segfault; Fix wrong inclusions