added checks to not allow directory writing
tested for DirectoryIterator support
Merge branch '0.3'
fixed after merge