Some more additions. Cleaned up code so it builds with -Weverything