Fixed some annoying warnings. Moved types.h to top level hierarchy