fixes #880 and another infered bug
merged