Correct some final bugs