Fixed registry key bug