Fixed the two bugs I had previously found