Just posting a possible fix for anyone having related issues.
I had problems connecting my S4 to internet through my dlink DIR-655. It connects to the wifi, but no internet.
None of the fixes suggested like updating firmware, changing to TKIP etc worked for me.
I tried to change different...