Fixed several bugs that came from adding pjm functionality