tests and fixes for core