PRD-4898 - Invalid boxing caused class-cast exception

(cherry picked from commit 1567e48)