Confluence Data Center - User Macro No Longer Functioning

Not sure when this started, but the following User Macro used to work (was developed by a predecessor). I initially had the issue with not having the velocity modules specified (https://jira.atlassian.com/browse/CONFSERVER-82741?src=confmacro), however after resolving that issue, the macro is showing some other issues.

Here is the macro:

## Macro title: Old Pages
## Macro has a body: Y or N (N)
## Body processing: Selected body processing option
## Output: Selected output option


## Macro to display pages that have not been updated for x days
## @param numdays:title=Number of Days|type=int|desc=Enter number of days to compare|required=true|multiple=false|default=7

#set ( $allPagesInSpace = $pageManager.getPages($space, true) )

## default value handler, set default to 7 days
#set ( $numdays = $paramnumdays )
#if(!$numdays)
#set ( $numdays = "7" )
#else
#set ( $numdays = $paramnumdays )
#end

## cast the number of days to an Integer
#set ( $Integer = 0 )
#set ( $intnumdays = $Integer.parseInt($numdays) )

## negative sign the number of days
#set ( $negativeDays = (-1 * $intnumdays) )

## get a calendar object so we can calculate the
## date we wish to compare with the page modification date
## e.g. $compareDate.add(6, -7) for pages modified over a week ago
#set ( $compareDate = $action.dateFormatter.getCalendar() )
$compareDate.setTime($content.getCurrentDate())
$compareDate.add(6, $negativeDays)

<p>Pages last updated before <strong>$action.dateFormatter.format($compareDate.getTime())</strong></p>

<table>
<tr>
<th>Page</th><th>Last Updated Date</th><th>Updated By</th>
</tr>

## loop through all the pages in the current space
#foreach($page in $allPagesInSpace)

## get a calendar object and for each page in space set it to last modification date
#set ($pagedate = $action.dateFormatter.getCalendar())
$pagedate.setTime($page.getLastModificationDate())

## only display pages last modified before the compare date
#if ($pagedate.before($compareDate))
<tr>
<td>#contentLink2($page true false)</td>
<td>$action.dateFormatter.format($page.getLastModificationDate())</td>
<td>#usernameLink($page.lastModifierName)</td>
</tr>
#end
#end
## end looping through pages in the current space

</table>

The attached screenshot shows the output on the Confluence page.

I believe that the $htmlUtil.htmlEncode($action.getUserFullName($username)) issue is that it is referencing the username field in the Content table in the database instead of the Lastmodifier field as some usernames actually return (though they are inactive users).

For the $htmlUtil.htmlEncode($content.displayTitle) issue, if I hover over the link, it does point to a valid Confluence page URL, however not sure why it no longer displays the actual page Title.

I have reviewed documentation related to writing User Macros, but I am not finding much to reference. Not sure what to change in the macro to resolve these issues. Any help would be appreciated.