Oscar Pistorius case: Is South Africa's legal system reliable?
Amid the controversy over the handling of the Oscar Pistorius murder investigation, the BBC's Farouk Chothia looks at how effective South Africa's criminal justice system really is.
South Africa's courts have a reputation of being fiercely independent and professional, giving well-considered judgements without fear or favour.
But critics say the same cannot be said of the police, who can be sloppy during investigations, weakening the prosecution's case.
"The perception is that there is a lack of discipline, skills and motivation in the police force, and the capacity to investigate cases has been reduced," Sam Sole, an investigative journalist with South Africa's Mail & Guardian newspaper, told the BBC.
"And if you have the best lawyers on the other side, they will scratch deeply to find flaws in the management of the case."
South African lawyer Jay Surju says that, even in a high-profile case such as that of Mr Pistorius, investigators seem to have handled the case in a shambolic manner.
"The defence managed to show incompetence on the part of the police - that the lead investigator entered the crime scene without his feet covered; that not all the evidence was picked up," he said.
It all goes to reveal that the police forensic units in South Africa are not "up to scratch", he says.
"They suffer from a lack of resources - both material and human. There are not enough laboratories, and there is a huge exodus of skilled people," he says.
"Forensic experts are underpaid, and they go into the private sector or overseas."
One of most prominent cases of poor police investigating was the acquittal six years ago of Cape Town statistician Fred Van der Vyver, accused of murdering his young student girlfriend in 2005.
Judge Anton Veldhuizen found that evidence brought forth in the 10-month trial was so weak that the case really should never have been brought to court.
He was critical of two police officials, one for being "negligent and reckless" in gathering fingerprint evidence at the crime scene, and the second for his investigation of a bloody shoe print which the officer knew had been discounted by an expert but did not pass this information to his colleagues or the director of public prosecutions.
Mr Van der Vyver subsequently won a case against the minister of police for malicious prosecution, claiming 46m rand ($5m; £3m) in damages - with a high court yet to rule on the amount he will be awarded.
At the time, forensic scientist David Klatzow, who worked for the defence team, said Mr Van der Vyver's case was not isolated.
"I see more and more cases," he said. "There is an incredible lack of competence in the police forensic team, to the great embarrassment, I should imagine, of those who are competent."
What seemed incredible to some in the Oscar Pistorius case was the revelation on day three of his bail hearing that chief investigator Detective Hilton Botha was facing reinstated accusations of attempted murder for allegedly shooting dead passengers in a minibus taxi in 2009.
He has now been replaced following the intervention of South Africa's police chief in what appeared to be a damage control exercise.
But Mr Surju says it is not an unusual situation for the police.
"While exercising their duties, police are often accused of committing crimes. If they are not suspended, they continue working."
Leading South African crime expert Antony Altbeker says it may seem like a "PR disaster", but the charges against Det Botha are unlikely to influence the outcome of any murder trial.
"A judge won't be terribly swayed by that. It is whether he produces the evidence, not that he is under investigation," he said.
Some observers have been surprised by the amount of evidence that has been presented at the bail hearing.
But in a report in South Africa's Daily Maverick newspaper, journalist Rebecca Davis says that both the prosecution and defence use the hearings to find out what evidence the other side has for the trial ahead.
"Legal experts point out that sometimes opposing bail is a way for the prosecution in a case to gain valuable insights into what will constitute the defence's case at trial," she says.
"It is apparently customary for the prosecution to lay out more of its case at this stage, but if bail is being opposed, the defence has to bring more to the table to keep its client out of jail awaiting trial."
Ms Davis writes that both legal teams carefully consider what evidence to disclose.
"Of course, there are some difficult considerations about exactly how much to reveal on both sides - especially because the information given at this stage is generally admissible in the full trial."
One of the key issues for South Africa's Paralympic star will be laws governing self-defence.
At his bail hearing, it was argued that Mr Pistorius fatally shot Reeva Steenkamp at his home at night after mistaking her for a burglar, in a country with a high rate of violent crime.
The prosecution said he had committed premeditated murder by firing multiple shots into the bathroom.
"If you are arguing that you shot in self-defence, you've got to show that your response was reasonable in the circumstances," explains Mr Surju.
"If someone is swinging a stick at you, you can't shoot them dead."
He says trial judges also consider other factors before giving their verdict.
"Did you fire a warning shot? Did you try to disable the person [by aiming at the leg, for instance]," Mr Surju says.
Similarly, the prosecution has to prove beyond reasonable doubt that murder was committed.
"When there are no direct witnesses you look at the circumstantial evidence and the timeline [of events] is critical," Mr Surju says.
It goes to show how critical the forensic evidence must be to get any conviction, and "we know in the Pistorius case there was not a proper analysis of the crime scene", he says.
"The more mistakes by the police, the more damaging it is for the prosecution's case - though not necessarily fatal."
In a departure from many other legal systems, trials in South Africa are heard by a judge - not a jury.
Constitutional lawyer Pierre de Vos argues that a jury system would not work in South Africa - a country polarised along racial and economic lines even 19 years after the end of apartheid.
"While I would normally trust judges to keep an open mind and to focus on facts actually proven by the state, I would not trust a jury of South African men and women to make decisions based on the facts instead of their own emotions and prejudices," he wrote on his blog.
"Unlike jurors, judges will not easily be swayed by gossip or even by serious and credible allegations about an accused in a criminal case published in the media."
Mr Surju agrees: "Our judges are trained to focus on the evidence in court - not on what the media is reporting. The judge is there to dispense justice, and he must do his job clinically. Any judgement he gives can be challenged in a higher court."
And Mr Altbeker argues that although South Africa has a low conviction rate in murder cases where a suspect has to be traced, it is "pretty high" when the suspect is known from the start of investigations.
"In Pistorius's case, it's very clear who pulled the trigger. That's not in dispute. The question is the circumstances in which he pulled the trigger," he says.