Fix cast.
Fix test dependency generation.