improving spec for issue 347
add spec for issue 775
add fix for issue 775