Removed a few bugs I introduced