Performance fixes #2