Fixed logical errors in java reader code for unknown types