Added error checking to replace all, fixed bug in metabolites table