fixed some errors pointed by R. Hubley