Fixed things found by code inspection tool