fixed codes for data type errors in derived vars