Made resize methods generic.