Fix some code for the limit/page string to int conversion

Thanks Toshio
Catch NoResultFound and IndexError exception when the package searched does not exist
Small code layout change
Fix some other conversion of limit/page to int
Let's not assume we always want 'Approved' packages in the search