That's how common law works, it's not disgusting, (unless perhaps you're an overzealous adherent of civil law) nor is it ex post facto. Legislation is produced, (claimed) grey areas are challenged in court, if the outcomes appear unfair then legislators (should) update the law.
Badly written law and poor legislators are a problem in any system.
Badly written law and poor legislators are a problem in any system.