jpcasting bugfix