The role of Loki was written for Jason Lee, but scheduling conflicts forced him to take on the smaller role of Azrael, and Matt Damon took over as Loki.