Fix bugs in plpy compiler: nested queries; indents in init function