Tweaks to prevent crashing.