obvious crash avoidance fixes
last merge of edumed-red not complete