Fixed some code that got messed up by commit

bug fixes