Fix cache spawn calculation with custom spawn

Fix cache spawn calculation when spawn specified as an arg