Properly remove ScriptCollection ViewPages to prevent crash.