Some API and include fixes