Added checks for Optional libraries