Fixed bug causing error in console