Issues #167 #168 fixing a code error