Made the create library safer and more const-correct