fixed bugs that were breaking tests