Fixed cast that caused compile error on 64bit machines.