The macro used for fetching a documents expiry time was specified incorrectly as $document.expiry rather than $document.exptime.