Fixed nasty crash