fix to pattern matcher and windows fixes