Fix issue 10800

Fix http://d.puremagic.com/issues/show_bug.cgi?id=10800

My first attempt at a pull request, so hopefully I didn't miss anything. If I did though, let me know and I'll fix it.