Fixed match issues, added some more felxibility