improve core test cases

See the single commit notes.