fixed stat functions to never return nil