Fixed a bug in tab cycling.