Fixed registration code bug