Fixed a few crashes there and there