Fixes and crash fixes