Ensure anonymous class constructor works properly