Niners, Ravens win key playoff games