Fix for issue #2

Without testing, but it works.