Fix bug if per_page passed as string