Make sure that an id represents a variable before adding it to an entry point's interface. Fixes #3297.