Fixed missing virtual constructors for Grid, GridXd and Function.