Adds tests for issue 307