fix compilation warnings and hlint warnings