Fix mkdir() to not fail due to derefing non-ref.