Fixed the most bizarre bug ever