added more formula tests, fixed bugs