Various fixes and changes for match conditions