Fixed calculating nested expressions