XRick: fixed some crashes