replace/wscript: do the size checks directly after the type checks