The optional sections here and at line 735 should be moved outside of the union statement.