Bug fixes to get the API working in a usual state