Fixed ARC errors and made some other modernizations to the codebase.