fixed bug with excludes for buffers

The original match call doesn't do the thing intended - `continue` only takes it to the next loop for checking of the buffer names. Furthermore, from `he match()`, `match` can return 0 when the match is at the beginning; the correct way should be comparing with `-1` - which is the value returned when there is no match found