--- a/pyke/krb_compiler/kfbparser.py
+++ b/pyke/krb_compiler/kfbparser.py
@@ -155,8 +155,7 @@
     '''
     global Fact_base
     init(this_module, check_tables, debug)
-    dirs, base = os.path.split(filename)
-    name = base[:-4]
+    name = os.path.basename(filename)[:-4]
     Fact_base = fact_base.fact_base(None, name, False)
     with open(filename) as f:
         scanner.init(scanner, debug, check_tables, True)