more cast work; all tests pass and old castValue() is gone