Fixed a potentially devastating bug