Found major bug and wrote test to make sure it doesn't happen again