Bug fixes: accidentally using a logical variable as an integer...
Bug fixes: accidentally using a logical variable as an integer...

hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,ruthfranklin/hande