Fix #311

Fix for issue #311