Ported included files cleanup
Ported chdir() to docroot
Some typos can be really bad...