Fixed undefined behaviour for orphan spinelements