Better documented code with some small fixes here and there.