Fixed bug when $activeRecords was empty