#312 reproduced
#312 fixed
#312 polished
#312 polished and fixed tests