Fix warnings flagged by IDEA