Show pagination when needed. Fixes #640