I got the library to compile.

The errors were just dumb mistakes repeated over and over again, due to blind copying I think (¬¬).

Here's what didn't compile:
- Trying to use from a finally block a variable in the try scope. I moved the declaration out of the try block.
- Trying to use an unassigned variable. I set it to null, since I didn't know what it was meant to have. Fix it please!

I also fixed a warning:
- Comparing a string with type object for equality with another string. I casted it to the string type.

There are also other warnings, but those aren't my business.