fixes #1514, #1423, #1501