Minor fixes, attempted improvements and etc

Tweaked the code a bit, changed a few things, updated some others and
substituted some.