Add type casting to encrypted attributes