Removed debugging code and fixed registration