Fix #3646, Revert part of 082c9d961e and fix highlight selected rules