bug fixes in Jade.cpp