This patch addresses a number of issues, large and small, that were identified by users in the downstream repo. * formatting of some code * specific option combinations leading to errors * missing includes for unit tests