Match function fixes