Added directory option, fixed static url.