added explicit conversion from long to int

This was to suppress the conversion warnings