Fix for issue #1051. Whoops.