Updated widget registration code.