Fixed couple of casting errors more.