Updated to work with latest gecko code.