Leonidg misc

A few small changes/bug fixes