fixed bug in constructor wrapper returning `undefined` when not chaining methods