some fixes for PSL example, however mostly changes to MEM and not pattern matching