FIX: Fix writing