Misc bug fixes an enhancements (sorry for bad desc)