Fix warnings

This fixes a few warnings in recently added code.

One of the warnings pointed to a bug (using a local deck variable that shadowed one in the outer scope) that has also been fixed.