Fixed pagination layout issue, closes #661