Throw more exceptions, introduce tailcall, fix indentation