bug fixes while adding test class for JError