Add a missing function header.
Fix return type to improve IDE integration.
Typo.
Use consistent messaging for last sync action.
$entity_id was getting defined after it was used.

Duplicates queue items were never caught.
Coding standards.