Add codegen for method invocations + fixes.