Fix for null graphics device after multiple matches