small cleanups and behavior fixes