Resolved some more warnings and static analysis issues