[BUGFIX] Use options only if they exist to avoid a notice
[CLEANUP] Minor cleanup in DB compare and clear cache tasks