Correct casting error