fixed some untested glitches which was causing 500 when question was posted.