Added tests and fixed a bug affecting init() not copying input singletons