I attempted to recreate the problem with the details you provided. Don't use the OR condition. While OR works well enough in most cases, it's what is causing the crashes in your case. Not sure about the other problems. More details are needed, or a cap would be nice.