fixed some warnings

Mainly just a couple of random code issues shown by IntelliJ.