#22019 and 26614 stories. Most of the work was done in previous commit.

@texasag ,@prabinv , @hippee-lee Please code review (hehehe).

26614 was fixed with the previous commit.