Reinitialize resource list with predefined size

If the script used resources, we can assume that it will be using them
again. This way we can improve performance a little.
Reset response code after request