Fixed cast error preventing tests from passing.