42247ad fixed some most obvious issues from static analysis

Authored and Committed by hhorak 8 years ago
    fixed some most obvious issues from static analysis