Attempted fix for bug #680

Kind of annoying to fix it this way, but it seems to be needed.