Fixed compilation issues and circular includes