fixed all the places where last error could be lost

whereby this commit should be applied to master anyway