Fix the bug which accesses undefined index
Make the directory lib, move library into it
Merge branch 'develop'