Add regression test for class initialization

See issue #618.