Made a bunch of cleanups/improvements, including: