fixes #980 #977
fixes #980 #977
fixes #983 #980
fixes #983