Bunch of bug fixes, added insert_spin usecase