Improve library checks