Added variable definition for $entry incase preference is set to 0

Otherwise the variable isn't known in the return.

Added check before pushing Book::getRecent on the array to also prevents errors down the road if there's no recent list to push.. And while we're at it, also added a check to skip adding empty libraries to the main list. No use staring at just the header and footer, even if they do look nice :)