Fixed a subtle bug in lib include selection