fix crazy java runtime exceptions