Fixed variables that weren't properly replaced