Various big fixes