Fixed write issues