Cannot register collection dynamically. Bug?