some fixes for complex expressions