Fixed flatten and compress