Fixed issue #312