Cleaned up code from Ryan's previous commits.