Fixes for issue 323