Pieces of my fix were added in the previous attempt, but not all of it. Fully implemented solution. Please let me know if it works
@cantel @aagaard @dcasper