Various cleanups/fixes