Fixed the ais=0 bug