Fix bugs in content.py and fix problem of directories.