Server error fixes

Some fixes from mathics.org django logs