Fix a few more possible bugs.