Fixes for notices and warnings

The changes are self evident.