Type casting and a little fix for forStatement