Fixed bug in obtaining Kj