Some library updates and improvements