Add DIRECTORY_SEPARATOR and changed to use Symfony2-like sprintf