Fixed some compilation bugs (like missing includes and stuff)