Science in the court: pitfalls, challenges and solutions