Ah, the reason it works I believe is that center gets overridden anyway. I've simplified the code further and removed the unnecessary initialization.