Various fixes #2