Fixes for some clippy bugs

Fixes #1481