Various trivial code corrections

Signed-off-by: Sergey Matveev <stargrave@stargrave.org>