Patmat: fix negation left from isEmpty&fix scoping

Should fix #188