Updated code.

Fix for issue #9