Fixed bug causing app to crash.