Fixed bug and minor logic issue