small fixes

help cleanup and debug if operations fail