Fixed bug where variables multiplied by zero ignored