Made select do more intelligent casting of constants.