Fixed bug with non-existing tabpages