Changed permission when creating writable directories from '0777' to (int) 0777