Use "getwinvar()" instead of "gettabwinvar()"
Use "fnameescape()" instead of custom function