Fixes issue with finding correct extension when message context is used.