Fixed typecast issue.