Fixed catastrophic bug