Some corrections in the libaries

Here are some suggestions in various modules.
Every commit is a different module.
I was sometimes not entirely sure and some review might be necessary.