Fixes to ensure compiles with dialyzer