Use same type signatures as upstream 2.1.3
Fix indenting to match upstream