Fix for executing a script on result cases with no view
Removed obsolete code and added comments