Fixed issue #307