[BUGFIX] Fix warnings/errors due to uninitialized variables

This fixes a number of warnings/errors caused by uninitialized or wrong
variables being used.
[TASK] Code cleanup

Removes unused imports, variables, code; docblock tweaks.
Merge pull request #3 from kdambekalns/fixes-cleanup

Fixes and cleanup