Prevent some exceptions