Prep for changes

Just some big fixes and cleanup and syncing with existing scripts.