Minor bug fixes in leave match