Minor - adding order conditions.
Fixing PHP warning.