removed explicit cast from several source files