bug fixed; minor changes