Added auto-init constructor

and tests to make sure it works