Cleaned up some more code. Also fixed a typo.