Fix mongo exception catching