Crash fixes, added some safeguards regarding items.