Fixed some bugs and rewrote some stuff related to abundances