Fix error with null shapes in expressions