Fix exception thrown when constructor cannot be found if the constructor is not needed, add some more tests