I'm not sure what `free_symbols` should do here.  It's defined on `Basic`s so I assume its looking for all symbols in all sorts of objects.  If, on the other hand, it should only look for symbols within expressions then this is probably incorrect.