diff --git a/lib/base.php b/lib/base.php
index acdea093d917d77e35b5459727c3a858f1906654..324b2f7e0a022b8e801473cbfc6b7f326996dc84 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -204,7 +204,11 @@ class OC_UTIL {
 			$file = $application;
 			$application = "";
 		}
-		self::$scripts[] = "$application/js/$file";
+		if( !empty( $application )){
+			self::$scripts[] = "$application/js/$file";
+		}else{
+			self::$scripts[] = "js/$file";
+		}
 	}
 
 	/**
@@ -217,7 +221,11 @@ class OC_UTIL {
 			$file = $application;
 			$application = "";
 		}
-		self::$styles[] = "$application/css/$file";
+		if( !empty( $application )){
+			self::$styles[] = "$application/css/$file";
+		}else{
+			self::$styles[] = "css/$file";
+		}
 	}
 
        /**
diff --git a/lib/helper.php b/lib/helper.php
index c4352ca33446d8280c0d3f53815b807bb6d97d8f..c141d6f04996a15f395d95bfc9e88eeaa4bba541 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -63,7 +63,11 @@ class OC_HELPER {
 		if( file_exists( "$SERVERROOT/apps/img/$app/$image" )){
 			return "$WEBROOT/apps/img/$app/$image";
 		}
-		return "$WEBROOT/$app/img/$image";
+		if( !empty( $app )){
+			return "$WEBROOT/$app/img/$image";
+		}else{
+			return "$WEBROOT/img/$image";
+		}
 	}
 
 	/**