Add new and fix old tests

Along with corresponding core changes