Fixup missing parameters and undefined variables

Change-Id: If5789fb7186bff7a9777b5cce29a6a13aa02767c