Fix casting table issues