Bluetooth serial trouble - RN-42

Hi,

I've been trying to connect my Duemilanove to an RN-42 Bluetooth modem(TX to RX, RX to TX). The modem connects perfectly, even enters command mode when prompted. The sketch I wrote sends data to the serial port. However there's nothing going through the BT modem. I cannot even see the TX/RX leds blinking (the same sketch works perfectly with USB). I also added a voltage divider to the TX of the Arduino to bring the voltage down from 5 volts. It seems that the board can't see the BT modem as a serial port. Do I need to define TX and RX as serial port in the sketch? Any help would be great!

This the sketch:

int val=0;
long randomvalue = 0;

void setup(){
Serial.begin(9600);
}
void loop(){
Serial. write(val);
randomvalue = random(1000);
Serial.println(randomvalue);
delay(2000);
}