Make it work with collection reform, remove some warnings