Copied in and modified reset, registration, etc.