Misc fix and improvements