Slight fixes for crashes