noticed that a useful chack had been erronesouly removed, must be from #297 in which this part of the code was edited. reinstating.
Merge branch 'master' into #305