Changed code to remove some compiler warnings.