Fix list.php for ajax filtering as per Issue 853.

Thanks to Angelo (genied) for providing this fix.

Note: I have not tested this myself.