Almost all Hlint warnings fixed