Changes for include order by clausule in select one (for select the first) and fix bug in the select count