Some fixes for Blackberry port.