Fix: Define mode as int