Readded lib directory; Fix build and tests