Fixes bug #4117

Fixes bug #4117: http://sourceforge.net/p/phpmyadmin/bugs/4117/

I couldn't reproduce the bug, but the problem seems pretty obvious.
I also spotted an unused function, which I removed.