Fixed register.php file handling