Added the fix for the case loop.