Fixed #include and rewrited file loading function