fix bugs, adapt for older version of numpy in ScienceTools