Cleaning up sloppy code that was causing errors.