Fixed a bug when was_slash and was_backslash would be left set; added tests for this issue