Small fixes to core, and also to app