Fixed lib files and minor changes on the code