Applying Kevin Huck's APEX patch