Fixed bugs I made in previous commit