Fixed a bug that resulted in a crash.