Added handling when the match list is empty or null.