Fix bugs were some vars were ints instead of doubles